package com.oa.web.action;

import javax.servlet.http.HttpServlet;
import java.util.Objects;

public class Dept extends HttpServlet {
    private String dname;
    private String loc;
    private String deptno;


    // 无参构造
    public Dept(){

    }

    // get and set
    public String getDeptno() {
        return deptno;
    }

    public void setDeptno(String deptno) {
        this.deptno = deptno;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getLoc() {
        return loc;
    }

    public void setLoc(String loc) {
        this.loc = loc;
    }


    // equals and hashcode
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Dept dept = (Dept) o;
        return Objects.equals(dname, dept.dname) && Objects.equals(loc, dept.loc) && Objects.equals(deptno, dept.deptno);
    }
    @Override
    public int hashCode() {
        return Objects.hash(dname, loc, deptno);
    }

    // toString

    @Override
    public String toString() {
        return "UserDept{" +
                "dname='" + dname + '\'' +
                ", loc='" + loc + '\'' +
                ", deptno='" + deptno + '\'' +
                '}';
    }
}
